import http from '@/http';
import type { menuType } from './MenuModel';


//获取上级菜单
export const getParentApi=()=>{
    return http.get('/api/menu/getParent');
}
//新增
export const addApi=(parm:menuType)=>{
    return http.post('/api/menu',parm)
}
//获取树形列表
export const getListApi=()=>{
    return http.get('/api/menu/getList')
}
//编辑
export const editApi=(parm:menuType)=>{
    return http.put('/api/menu',parm)
}
//删除
export const deleteApi=(menuId:string)=>{
    return http.delete(`/api/menu/${menuId}`)
}
//获取动态菜单接口
export const getMenuListApi=(userId:string)=>{
    return http.get('/api/menu/getMenuList', {userId:userId})
}